<template>
    <div>
        <el-table
                :data="tableData"
                border
                stripe
                style="width: 100%">
            <el-table-column
                    prop="date"
                    label="日期"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="address"
                    label="地址">
            </el-table-column>
        </el-table>
        <hr>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="活动名称">
                <el-input v-model="form.name"></el-input>
            </el-form-item>
        </el-form>
        <el-button type="primary" @click="create">主要按钮</el-button>
    </div>
</template>

<script lang="ts">
    import {Component, Vue} from "vue-property-decorator";
    import {ModelListClass} from '@/model/modelList.ts';
    import {ModelListService} from '../../api/modelList';

    @Component
    export default class ModelList extends Vue {

        private tableData: ModelListClass[] = [];

        private form: ModelListClass = new ModelListClass();

        public mounted() {
            ModelListService.getData().then(res => {
                this.tableData = res
            })
        }

        public create(): void {
            console.log(this.form)
        }
    }
</script>

<style lang="scss">

</style>
